package com.ck.client.service;

import com.ck.common.model.Device;
import com.ck.common.model.bo.DeviceKeyMsg;
import com.ck.common.model.bo.DeviceReportBO;

import java.util.List;

public interface DeviceInfoService {

	/**
	 *   终端首次联网，注册信息
	 *
	 * @param device Device类型对象
	 */
	boolean register(Device device);

	/**
	 * 通过code获取终端
	 *
	 * @param deviceCode 
	 * @return Device
	 */
	Device getDeviceInfoByCode(String deviceCode);
	
	/**
	 *  终端实时上报更新信息
	 *
	 * @param reportDevice   DeviceReportBO类型对象
	 */
	boolean report(DeviceReportBO reportDevice);
	
	/**
	 * 更新终端表版本升级信息
	 * @param deviceCode
	 * @param softwareVer
	 * @param softwareUpdateTime
	 * @param firmwareVer
	 * @param firmwareUpdateTime
	 * @return
	 */
	boolean updateDeviceUpgradeInfo(String deviceCode,String softwareVer, Long softwareUpdateTime, String firmwareVer,Long firmwareUpdateTime);
	
	/**
	 * 终端是否已经存在
	 * @param deviceCode
	 * @return
	 */
	boolean isAlreadyExists(String deviceCode);
	
	/**
	 * 根据deviceCode获取设备关键信息
	 * @param deviceCode
	 * @return
	 */
	DeviceKeyMsg getDeviceKeyMsg(String deviceCode);
	
	/**
	 * 设备二次注册
	 * @param deviceCode
	 * @param token
	 * @param deviceGroupId
     * @return
	 */
	boolean secondRegister(String deviceCode, String token, Long deviceGroupId);

	/**
	 * 设置设备的附属信息
	 * @param deviceCode
	 * @param deviceMac
	 * @param modelName
	 * @param resolution
	 */
	void setDeviceInfo(String deviceCode,String deviceMac, String modelName, String resolution);

	/**
	 * 获取离线设备的唯一编码
	 * @param timeDiff
	 * @return
	 */
	List<String> getOffLineDevice(Long timeDiff);

	/**
	 * 设置设备的状态为离线
	 * @param timeDiff
	 * @return
	 */
	int setDeviceOffLine(Long timeDiff);

	/**
	 * 获取终端分辨率
	 * @param deviceCode
	 * @return
	 */
    String getDeviceResolution(String deviceCode);
}
